import {
	defineStore
} from 'pinia';
const useHomeStore = defineStore('home', {
	state: () => ({
		projectList: [], //项目列表
		projectId: '', //项目id
		projectName: '', //项目名称
		projectType: '', //项目类型，冷间、机组、冷凝器
		projectModus: {}, //项目模块
		deviceId: '', //设备id
		deviceName: '', //设备名称
		deviceType: '', //设备类型，风机、灯组、门
		deviceList: [], //设备列表
		facilityId: '', //设施id
		facilityName: '', //设施名称
		facilityList: [], //设施列表
		warnId: '', //告警id
		pointInfo: {},
		projectTypeList: [{
			name: "冷间",
			id: "20",
			child: [{
				name: "风机",
				id: "26"
			}, {
				name: "灯组",
				id: "27"
			}, {
				name: "门",
				id: "24"
			}]
		}, {
			name: "机组",
			id: "40"
		}, {
			name: "冷凝器",
			id: "30"
		}],

	}),
	actions: {
		setProjectList(data) {
			this.projectList = data;
		},
		setProjectId(data) {
			this.projectId = data;
		},
		setProjectName(data) {
			this.projectName = data;
		},
		setProjectType(data) {
			this.projectType = data;
		},
		setProjectModus(data) {
			this.projectModus = data;
		},
		setDeviceId(data) {
			this.deviceId = data;
		},
		setDeviceName(data) {
			this.deviceName = data;
		},
		setDeviceType(data) {
			this.deviceType = data;
		},
		setDeviceList(data) {
			this.deviceList = data;
		},
		setFacilityId(data) {
			this.facilityId = data;
		},
		setFacilityName(data) {
			this.facilityName = data;
		},
		setFacilityListList(data) {
			this.facilityList = data;
		},
		setWarnId(data) {
			this.warnId = data;
		},
		setPointInfo(data) {
			this.pointInfo = data;
		},
		clearProjectData() {
			this.projectList = [];
			this.projectId = "";
			this.projectName = "";
			this.projectType = "";
			this.projectModus = {};
			this.deviceId = "";
			this.deviceName = "";
			this.deviceType = "";
			this.deviceList = [];
			this.facilityId = "";
			this.facilityName = "";
			this.facilityList = [];
			this.warnId = "";
			this.pointInfo = {};
		}
	}
})
export default useHomeStore